package com.gopay.common.constants.cloud;

/**
 * Created by Johnson on 2016/12/30.
 */
public enum CloudCertType {

    /**
     * 身份证 正面
     */
    ID_CARD_FRONT("ID_CARD_FRONT"),
    /**
     * 身份证 反面
     */
    ID_CARD_BACK("ID_CARD_BACK"),
    /**
     * 手持身份证
     */
    HANDHELD_ID_CARD("HANDHELD_ID_CARD"),
    /**
     * 营业执照
     */
    BUSSINESS_LICENSE("BUSSINESS_LICENSE"),
    /**
     * 组织机构代码证
     */
    ORGANIZATION_CODE("ORGANIZATION_CODE"),
    /**
     * 税务登记证
     */
    TAX_REGISTRATION("TAX_REGISTRATION"),
    /**
     * 银行开户许可证
     */
    BANK_ACCOUNT_LICENCE("BANK_ACCOUNT_LICENCE");


    public final String value;

    CloudCertType(String value) {
        this.value = value;
    }

    public static CloudCertType get(String value) {
        CloudCertType[] certTypes = CloudCertType.class.getEnumConstants();
        for(CloudCertType certType : certTypes) {
            if(certType.value.equals(value)) {
                return certType;
            }
        }
        throw new RuntimeException("wrong " + CloudCertType.class.getSimpleName() + " string value!" + value);
    }

}
